<!-- Registro -->
<%@ page contentType="text/html; charset=UTF-8" %>
<% String idi = (String) session.getAttribute("idioma"); %>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<% if(session.getAttribute("userName") != null)
{
    response.sendRedirect("index.jsp");
}
else
{ %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <fmt:setLocale value="<%=idi%>"/>
    <fmt:bundle basename="etiquetas" >
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <link rel="stylesheet" type="text/css" href="/css/general.css" />
            <link rel="shortcut icon" href="../images/icons/favicon.ico"/>
            <script language="JavaScript" type="text/javascript" src="scripts/funciones.js"></script>
            <title><fmt:message key="titulo" /></title>
        </head>

        <body>
            <!-- Contenedor principal-->
            <div id="contenedor">

                <!--Cabecera-->
                <div id="headerGeneral">
                    <jsp:include page="/WEB-INF/include/header.jsp" />
                </div>

                <!-- Contenido de la pagina -->
                <div id="content">

                    <!-- Contenido de la columna derecha -->
                    <div id="contentRight">
                        <p>
                            <span class="contentHeader"><fmt:message key="registro" /></span><br />
                        </p>

                        <form action="/registrar" method="post" name="registroForm" id="registroForm">

                            <fmt:message key="nombre_usuario" /><br />
                            <input id="username" name="username" type="text" size="30" maxlength="45" value="${username}" />
                            <span class="error" id="errorUser"><fmt:message key="error_CampoRequerido" /></span><br /><br />

                            <fmt:message key="password" /><br />
                            <input id="password" name="password" type="password" size="30" maxlength="45" value="${password}" />
                            <span class="error" id="errorPass"><fmt:message key="error_CampoRequerido" /></span><br /><br />

                            <fmt:message key="password_repetido" /><br />
                            <input id="repeatPassword" name="repeatPassword" type="password" size="30" maxlength="45" value="${repeatPassword}" />
                            <span class="error" id="errorRepeatPass"><fmt:message key="error_CampoRequerido" /></span>
                            <span class="error" id="errorPassIguales"><fmt:message key="error_PasswordRepetido" /></span><br /><br />
                            <fmt:message key="email" /><br />
                            <input id="email" name="email" type="text" size="30" maxlength="45" value="${email}" />
                            <span class="error" id="errorMail"><fmt:message key="error_CampoRequerido" /></span><br /><br />

                            <input type="button" value="<fmt:message key="boton_CrearUsuario" />" onclick="validarFormRegistro()" />
                            <span class="ok">${mensajeCorrecto}</span>
                            <span class="error">${mensajeError}</span>
                        </form>
                    </div>
                </div>  
                        
            <!-- Pie de pagina -->
            <%@include file="/WEB-INF/include/footer.jsp" %>
            </div>
        </body>
            
    </fmt:bundle>
    </html>
<% } %> 